home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / pc / ps40sdk / examples / common / headers.h / piexport.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-14  |  6.7 KB  |  196 lines

  1. /*
  2.     File: PIExport.h
  3.  
  4.     Copyright (c) 1990-1, Thomas Knoll.
  5.     Copyright (c) 1992-6, Adobe Systems, Incorporated.
  6.     All rights reserved.
  7.  
  8.     This file describes version 4.0 of Photoshop's Export module interface.
  9. */
  10.  
  11. #ifndef __PIExport__
  12. #define __PIExport__
  13.  
  14. #include "PIActions.h"
  15. #include "PIGeneral.h"
  16.  
  17. /* Operation selectors */
  18.  
  19. #define exportSelectorAbout    0
  20. #define exportSelectorStart    1
  21. #define exportSelectorContinue 2
  22. #define exportSelectorFinish   3
  23. #define exportSelectorPrepare  4
  24.  
  25. /* Error return values. The plug-in module may also return standard Macintosh
  26.    operating system error codes, or report its own errors, in which case it
  27.    can return any positive integer. */
  28.  
  29. #define exportBadParameters -30200    /* "a problem with the export module interface" */
  30. #define exportBadMode        -30201    /* "the export module does not support <mode> images" */
  31.  
  32. /******************************************************************************/
  33.  
  34. #define PIExpFlagsProperty        0x65787066 /* 'expf' <Set> Export flags */
  35.  
  36. /******************************************************************************/
  37.  
  38. /* Export flag indices. */
  39.  
  40. #define PIExpSupportsTransparency 0
  41.  
  42. /******************************************************************************/
  43. /* Pragma to byte align structures; only for Borland C */
  44.  
  45. #if defined(__BORLANDC__)
  46. #pragma option -a-
  47. #endif
  48.  
  49. /******************************************************************************/
  50.  
  51. #if PRAGMA_ALIGN_SUPPORTED
  52. #pragma options align=mac68k
  53. #endif
  54.  
  55. typedef struct ExportRecord
  56.     {
  57.  
  58.     int32            serialNumber;    /* Host's serial number, to allow
  59.                                        copy protected plug-in modules. */
  60.  
  61.     TestAbortProc    abortProc;        /* The plug-in module may call this no-argument
  62.                                        BOOLEAN function (using Pascal calling
  63.                                        conventions) several times a second during long
  64.                                        operations to allow the user to abort the operation.
  65.                                        If it returns TRUE, the operation should be aborted
  66.                                        (and a positive error code returned). */
  67.  
  68.     ProgressProc    progressProc;    /* The plug-in module may call this two-argument
  69.                                        procedure periodically to update a progress
  70.                                        indicator.  The first parameter is the number
  71.                                        of operations completed; the second is the total
  72.                                        number of operations. */
  73.  
  74.     int32            maxData;        /* Maximum number of bytes that should be
  75.                                        requested at once (the plug-in should reduce
  76.                                        its requests by the size any large buffers
  77.                                        it allocates). The plug-in may reduce this
  78.                                        value in the exportSelectorPrepare routine. */
  79.  
  80.     int16            imageMode;        /* Image mode */
  81.     Point            imageSize;        /* Size of image */
  82.     int16            depth;            /* Bits per sample, currently will be 1 or 8 */
  83.     int16            planes;         /* Samples per pixel */
  84.  
  85.     Fixed            imageHRes;        /* Pixels per inch */
  86.     Fixed            imageVRes;        /* Pixels per inch */
  87.  
  88.     LookUpTable        redLUT;         /* Red LUT, only used for Indexed Color images */
  89.     LookUpTable        greenLUT;        /* Green LUT, only used for Indexed Color images */
  90.     LookUpTable        blueLUT;        /* Blue LUT, only used for Indexed Color images */
  91.  
  92.     Rect            theRect;        /* Rectangle requested, set to empty rect when done */
  93.     int16            loPlane;        /* First plane requested */
  94.     int16            hiPlane;        /* Last plane requested */
  95.  
  96.     void *            data;            /* A pointer to the requested image data */
  97.     int32            rowBytes;        /* Spacing between rows */
  98.  
  99.     Str255             filename;        /* Document file name */
  100.     int16            vRefNum;        /* Volume reference number, or zero if none */
  101.     Boolean         dirty;            /* Changes since last saved flag. The plug-in may clear
  102.                                        this field to prevent prompting the user when
  103.                                        closing the document. */
  104.  
  105.     Rect            selectBBox;     /* Bounding box of current selection, or an empty
  106.                                        rect if there is no current selection. */
  107.  
  108.     OSType            hostSig;        /* Creator code for host application */
  109.     HostProc        hostProc;        /* Host specific callback procedure */
  110.  
  111.     Handle            duotoneInfo;    /* Handle to duotone information. */
  112.  
  113.     int16            thePlane;        /* Currently selected channel,
  114.                                        or -1 if a composite color channel,
  115.                                        or -2 if all channels. */
  116.  
  117.     PlugInMonitor    monitor;        /* Information on current monitor */
  118.  
  119.     void *            platformData;    /* Platform specific hook. */
  120.  
  121.     BufferProcs *    bufferProcs;    /* Host buffer maintenance procedures. */
  122.     
  123.     ResourceProcs *    resourceProcs;    /* Host plug-in resource procedures. */
  124.     
  125.     ProcessEventProc processEvent;    /* Pass events to the application. */
  126.     
  127.     DisplayPixelsProc displayPixels;/* Display dithered pixels. */
  128.  
  129.     HandleProcs        *handleProcs;    /* Platform independent handle manipulation. */
  130.  
  131.     /* New in 3.0. */
  132.  
  133.     ColorServicesProc colorServices; /* Routine to access color services. */
  134.     
  135.     GetPropertyProc    getPropertyObsolete; /* Use the suite if available */
  136.                                        
  137.     AdvanceStateProc advanceState;    /* Allowed from Start and Continue. */
  138.     
  139.     int16            layerPlanes;
  140.     int16            transparencyMask;
  141.     int16            layerMasks;                /* Zero. */
  142.     int16            invertedLayerMasks;        /* Zero. */
  143.     int16            nonLayerPlanes;
  144.                                        
  145.     /* Note that the layer mask fields are necessarily zero in 3.0.4 since
  146.        the export module receives the merged data and the merged data doesn't
  147.        really have a layer mask associated with it. */
  148.                                        
  149.     /* New in 3.0.4. */
  150.     
  151.     ImageServicesProcs *imageServicesProcs;
  152.                                         /* Suite of image processing callbacks. */
  153.     
  154.     int16                tileWidth;        /* The width of the tiles. Zero if not set. */
  155.     int16                tileHeight;        /* The height of the tiles. Zero if not set. */
  156.     
  157.     Point                tileOrigin;        /* The origin point for the tiles. */
  158.  
  159.     PropertyProcs    *propertyProcs;    /*    Routines to query and set document and
  160.                                         view properties. The plug-in needs to
  161.                                         dispose of the handle returned for
  162.                                         complex properties (the plug-in also
  163.                                         maintains ownership of handles for
  164.                                         set properties.
  165.                                     */
  166.     
  167.     /* New in 4.0 */
  168.     
  169.     PIDescriptorParameters    *descriptorParameters;    /* For recording and playback */
  170.     Str255                    *errorString;            /* For silent and errReportString */
  171.  
  172.     ChannelPortProcs *channelPortProcs;
  173.                                     /* Suite for passing pixels through channel ports. */
  174.             
  175.     ReadImageDocumentDesc *documentInfo;    /* The document info for the document being filtered. */
  176.     
  177.     char            reserved [178]; /* Set to zero */
  178.  
  179.     }
  180. ExportRecord, *ExportRecordPtr;
  181.  
  182. #if PRAGMA_ALIGN_SUPPORTED
  183. #pragma options align=reset
  184. #endif
  185.  
  186. /******************************************************************************/
  187. /* turn off the byte align pragma back to its original state; only for Borland C */
  188.  
  189. #if defined(__BORLANDC__)
  190. #pragma option -a.
  191. #endif
  192.  
  193. /******************************************************************************/
  194.  
  195. #endif
  196.